import logging, yagmail,pytest
import HTMLTestRunner_cn


class Tools():
    def Mail(self):
        mail=yagmail.SMTP(user='2109784600@qq.com',password='synbwxintrzybegg',host='smtp.qq.com')
        mail.send(to='2109784600@qq.com',subject='维度系列测试产出物',contents=['描述','WMS_pytest.html','wms_pytest.log'])
        mail.close()

    def log1(self):
        log=logging.basicConfig(level=logging.DEBUG,
                                  format='%(levelname)s %(asctime)s %(message)s %(filename)s %(lineno)d',
                                  filename='wms_pytest.log',
                                  filemode='w+')
        return log


    def report(self):
        report=HTMLTestRunner_cn.HTMLTestRunner(open('WMS_pytest.html','wb'),
                                                 title='仓储管理业务',
                                                 description="仓储管理业务，涉及业务5条")
        return report
